package com.wenson.inherit;

/**
 * @author: luowangcheng
 * @data：2024/6/8 09:35
 * @description:
 */
public class Dog {
    protected String breeds; // 品种
    protected boolean sex; // 性别
    protected String color; // 毛色
    protected int age; // 年龄
    public Dog(String breeds){
        this.age = 0; // 初始化年龄为0
        this.breeds = breeds; // 品种外部传入
    }

    // 吠叫
    public void bark(){
        System.out.println("汪汪汪");
    }
    public String getBreeds() {
        return breeds;
    }

  /*  假设出生后就不能变化品种，那么此处不应该暴露setBreeds方法
    public void setBreeds(String breeds) {
        this.breeds = breeds;
    }*/

    public boolean isSex() {
        return sex;
    }

    public void setSex(boolean sex) {
        this.sex = sex;
    }

    public String getColor() {
        return color;
    }

    public void setColor(String color) {
        this.color = color;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }
}
